﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DtsExplorerProject.Helpers
{
    static public class ExcludeEmptyExtensionClass
    { 
        static public ArrayList ExcludeNullOrEmpty(this IEnumerable e)
        {

            ArrayList list = new ArrayList();

            foreach (var item in e)
            {
                if (e.GetEnumerator().Current != null)
                {
                    list.Add(e.GetEnumerator().Current);
                }
            }

            return list;
        }
        static public string[] ExcludeStringNullOrEmpty(this string[] e)
        {
            List<string> list = new List<string>();
            int i = 0;
            foreach (var item in e)
            {
                bool temp = string.IsNullOrEmpty(e[i].ToString());
                if (!temp)
                {
                    list.Add(e[i]);
                }
                i++;
            }

            return list.ToArray();
        }
    }
}
